{extend name='admin@main'}

{block name="button"}
<!--{if auth("store/goods/add")}-->
<!-- <button data-open='{:url("add")}' data-title="添加套餐" class='layui-btn layui-btn-sm layui-btn-primary'>添加套餐</button> -->
<!--{/if}-->
<!--{if auth("store/goods/remove")}-->
<!-- <button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除套餐</button> -->
<!--{/if}-->
{/block}

{block name="content"}
{php}
{//var_dump($list);}
{/php}
<div class="think-box-shadow">
    {include file='goods/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
<!--             <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th> -->
            <th class='text-left nowrap'>套餐名称</th>
            <th class='text-left nowrap'>套餐状态</th>
            <th class='text-left nowrap'>套餐详情</th>
<!--             {if $userinfo['db1']['authorize'] ==1 }
                <th class='text-left nowrap'>库存 / 销量</th>
            {/if} -->
            <th>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>{$vo.id}</td>
          <!--   <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.id}" class="list-sort-input"></td> -->
            <td class='text-left nowrap'>
                {notempty name='vo.logo'}
                <img data-tips-image style="width:60px;height:60px" src="{$vo.logo|default=''}" class="margin-right-5 text-top">
                {/notempty}
                <div class="inline-block">
  <!--                   套餐编号：{$vo.id|default='--'}<br>
                    所属分类：{$vo.cate.title|default='--'}<br> -->
                 <!--    套餐名称： -->{$vo.title|default='--'}<!-- <br> -->
                </div>
            </td>
            <td class='text-left nowrap'>
                套餐价格：{$vo.money|default='0.00'} 元<br>
               <!--  分成比例：{#$vo.id+0} %<br> -->
                销售状态：{eq name='vo.status' value='0'}<span class="layui-badge layui-bg-green">销售中</span>{else}<span class="layui-badge">已下架</span>{/eq}<br>
            </td>
            <td class='text-left nowrap padding-0 relative'>
              <!--   套餐名称：<span class="color-blue">{$vo.commodity_title|default=''}</span>
                <br> -->
                套餐类型:<strong class="color-blue">

                <span class="color-green font-s12">
                  

                  {switch name="vo.type" }
  
                            {case value='1'}个人套餐{/case}
                            {case value='2'}企业套餐{/case}  
                            {case value='3'}物业套餐{/case}
                            {default  /}-
                {/switch}
                </span>
               <!--  {$vo.commodity_remark|default=''} -->


            </strong> 
                <br>
                套餐期限:
                {if condition="($vo.year neq 0)"}
                    <span class="color-blue">{$vo.year|default=''}/年付</span>
                {elseif condition="($vo.month neq 0)"/}
                    <span class="color-blue">{$vo.month|default=''}/月付</span>
                {elseif condition="($vo.day neq 0)"/}
                    <span class="color-blue">{$vo.day|default=''}/日付</span>
                {else /}
                {/if}
                <br>
              <!--   {if condition="($vo.outAppnumber neq 0)"}
                限制接待人数:
                <span class="color-blue">{$vo.outAppnumber|default=''}人</span>
                {/if} -->
                {if condition="($vo.outnumber neq 0)"}
                限制公司人数:
                <span class="color-blue">{$vo.outnumber|default=''}人</span>
                {/if}

                套餐积分: <span class="color-blue">{$vo.frequency}</span>




            </td>

 <!--            {if $userinfo['db1']['authorize'] ==1 }
                <td class='text-left nowrap padding-0 relative'>
                    ----|----

                </td>
            {/if} -->
            <td class='text-left nowrap'>

                <div class="nowrap margin-bottom-5">
                    {if auth("store/goods/edit")}
                    <a data-dbclick class="layui-btn layui-btn-sm"  data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                    {else}
                    <a data-tips-text="您没有编辑套餐的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">编 辑</a>
                    {/if}
           {if isset($vo.status) and $vo.status eq 0}
                    {if auth("store/goods/forbid")}
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('status')}" data-value="id#{$vo.id};status#1">禁 用</a>
                    {else}
                    <a data-tips-text="您没有下架套餐的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">禁 用</a>
                    {/if}
                    {else}
                    {if auth("store/goods/resume")}
                    <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('status')}" data-value="id#{$vo.id};status#0">启 用</a>
                    {else}
                    <a data-tips-text="您没有上架套餐的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">启 用</a>
                    {/if}
                    {/if}
                </div>

                <div class="nowrap margin-bottom-5">

                    {if auth("store/goods/stock")}
                   <!--  <a class="layui-btn layui-btn-sm layui-btn-normal" data-title="套餐入库" data-modal='{:url("stock")}?id={$vo.id}'>入 库</a> -->
                    {else}
                   <!--  <a data-tips-text="您没有套餐入库的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">入 库</a> -->
                    {/if}

                    {if auth("store/goods/remove")}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
                    {else}
                    <a data-tips-text="您没有删除套餐的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删 除</a>
                    {/if}

                </div>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    <fieldset>
    <legend>操作选项</legend>
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除套餐</button>
</fieldset>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
